#include "xc_private.h"
+void *xc_map_foreign_range(xc_interface *xch, uint32_t dom,
+ int size, int prot, unsigned long mfn)
+{
+ return xch->ops->u.privcmd.map_foreign_range(xch, xch->ops_handle,
+ dom, size, prot, mfn);
+}
+
void *xc_map_foreign_batch(xc_interface *xch, uint32_t dom, int prot,
- xen_pfn_t *arr, int num )
+ xen_pfn_t *arr, int num)
{
return xch->ops->u.privcmd.map_foreign_batch(xch, xch->ops_handle,
dom, prot, arr, num);
return xch->ops->u.privcmd.map_foreign_bulk(xch, xch->ops_handle,
dom, prot, arr, err, num);
}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
return addr;
}
-void *xc_map_foreign_range(xc_interface *xch, uint32_t dom, int size, int prot,
- unsigned long mfn)
+static void *linux_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
+ uint32_t dom, int size, int prot,
+ unsigned long mfn)
{
xen_pfn_t *arr;
int num;
.map_foreign_batch = &linux_privcmd_map_foreign_batch,
.map_foreign_bulk = &linux_privcmd_map_foreign_bulk,
+ .map_foreign_range = &linux_privcmd_map_foreign_range,
},
};
return (void *) addr;
}
-void *xc_map_foreign_range(xc_interface *xch, uint32_t dom,
- int size, int prot,
- unsigned long mfn)
+static void *minios_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
+ uint32_t dom,
+ int size, int prot,
+ unsigned long mfn)
{
unsigned long pt_prot = 0;
#ifdef __ia64__
.map_foreign_batch = &minios_privcmd_map_foreign_batch,
.map_foreign_bulk = &minios_privcmd_map_foreign_bulk,
+ .map_foreign_range = &minios_privcmd_map_foreign_range,
},
};
}
-void *xc_map_foreign_range(xc_interface *xch, uint32_t dom,
- int size, int prot,
- unsigned long mfn)
+static void *netbsd_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
+ uint32_t dom,
+ int size, int prot,
+ unsigned long mfn)
{
+ int fd = (int)h;
privcmd_mmap_t ioctlx;
privcmd_mmap_entry_t entry;
void *addr;
entry.va=(unsigned long) addr;
entry.mfn=mfn;
entry.npages=(size+PAGE_SIZE-1)>>PAGE_SHIFT;
- if ( ioctl(xch->fd, IOCTL_PRIVCMD_MMAP, &ioctlx) < 0 )
+ if ( ioctl(fd, IOCTL_PRIVCMD_MMAP, &ioctlx) < 0 )
{
int saved_errno = errno;
PERROR("xc_map_foreign_range: ioctl failed");
.map_foreign_batch = &netbsd_privcmd_map_foreign_batch,
.map_foreign_bulk = &xc_map_foreign_bulk_compat,
+ .map_foreign_range = &netbsd_privcmd_map_foreign_range,
},
};
}
-void *xc_map_foreign_range(xc_interface *xch, uint32_t dom,
- int size, int prot,
- unsigned long mfn)
+static void *xc_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
+ uint32_t dom,
+ int size, int prot,
+ unsigned long mfn)
{
+ int fd = (int)fd;
privcmd_mmap_t ioctlx;
privcmd_mmap_entry_t entry;
void *addr;
- addr = mmap(NULL, size, prot, MAP_SHARED, xch->fd, 0);
+ addr = mmap(NULL, size, prot, MAP_SHARED, fd, 0);
if ( addr == MAP_FAILED )
return NULL;
entry.va=(unsigned long) addr;
entry.mfn=mfn;
entry.npages=(size+PAGE_SIZE-1)>>PAGE_SHIFT;
- if ( ioctl(xch->fd, IOCTL_PRIVCMD_MMAP, &ioctlx) < 0 )
+ if ( ioctl(fd, IOCTL_PRIVCMD_MMAP, &ioctlx) < 0 )
{
int saved_errno = errno;
(void)munmap(addr, size);
.map_foreign_batch = &solaris_privcmd_map_foreign_batch,
.map_foreign_bulk = &xc_map_foreign_bulk_compat,
+ .map_foreign_range = &solaris_privcmd_map_foreign_range,
},
};
xen_pfn_t *arr, int num);
void *(*map_foreign_bulk)(xc_interface *xch, xc_osdep_handle h, uint32_t dom, int prot,
const xen_pfn_t *arr, int *err, unsigned int num);
+ void *(*map_foreign_range)(xc_interface *xch, xc_osdep_handle h, uint32_t dom, int size, int prot,
+ unsigned long mfn);
} privcmd;
} u;
};